package com.pcbly.web.components.utils.fileupload;

import org.apache.log4j.Logger;

/**
 * 文件上传状态管理器
 * @author cleverpig
 *
 */
public class FileUploadStatusBeanManager {	
	
	protected static Logger logger=Logger.getLogger(FileUploadStatusBeanManager.class);
	/**
	 * 初始化文件上传状态Bean
	 * @param request
	 * @return
	 */
	public static FileUploadStatus initFUSBean(){
		
		FileUploadStatus fUploadStatus=new FileUploadStatus();
		fUploadStatus.setStatus("正在初始化...");
		fUploadStatus.setUploadTotalSize(0);
		fUploadStatus.setProcessStartTime(0);
		fUploadStatus.setBaseDir("");
		fUploadStatus.setProcessEndTime(0);
		fUploadStatus.setReadTotalSize(0);
		fUploadStatus.setProcessRunningTime(0);
		logger.debug("初始化文件上传状态Bean");
		return fUploadStatus;
	}
	
	/**
	 * 重置文件上传状态Bean
	 * @param request
	 * @return
	 */
	public static FileUploadStatus resetFUSBean(FileUploadStatus fUploadStatus){
		fUploadStatus.setStatus("正在初始化...");
		fUploadStatus.setUploadTotalSize(0);
		fUploadStatus.setProcessStartTime(0);
		fUploadStatus.setBaseDir("");
		fUploadStatus.setProcessEndTime(0);
		fUploadStatus.setReadTotalSize(0);
		fUploadStatus.setProcessRunningTime(0);
		logger.debug("初始化文件上传状态Bean");
		return fUploadStatus;
	}

}